Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove call to componentWillReceiveProps #164

Closed
wants to merge 1 commit into from
Closed

Remove call to componentWillReceiveProps #164

wants to merge 1 commit into from

Conversation

daggmano
Copy link

if (id !== this.props.id) {
this.setState({ inputId: id || generateId() });
this.setState({ inputId: this.props.id || generateId() });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More correct to use getDerivedStateFromProps for update state based on props

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance difference is despicable. Can't we move ahead and approve the PR? Using this deprecated event is much worse than this detail

@pbalenzuela
Copy link

any updates on this?

Copy link

@pbalenzuela pbalenzuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. What is requested to be changed is just a detail

@0xdevalias
Copy link

Any updates on this?

@Methuselah96
Copy link
Contributor

I've made a fork with the fix for this released as [email protected].

@Methuselah96
Copy link
Contributor

Methuselah96 commented Dec 5, 2020

Created an alternative PR that uses getDerivedStateFromProps that should replace this one.

@JedWatson
Copy link
Owner

We've merged #177 so this has been fixed, thanks for the PR @daggmano and sorry I didn't get to it sooner

@JedWatson JedWatson closed this Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants